package com.ruoyi.wcf.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wcf.mapper.WcfSupplierMapper;
import com.ruoyi.wcf.domain.WcfSupplier;
import com.ruoyi.wcf.service.IWcfSupplierService;

/**
 * 供应商Service业务层处理
 *
 * @author WZP
 * @date 2022-04-02
 */
@Service
public class WcfSupplierServiceImpl implements IWcfSupplierService
{
    @Autowired
    private WcfSupplierMapper wcfSupplierMapper;

    /**
     * 查询供应商
     *
     * @param supplierId 供应商主键
     * @return 供应商
     */
    @Override
    public WcfSupplier selectWcfSupplierBySupplierId(Long supplierId)
    {
        return wcfSupplierMapper.selectWcfSupplierBySupplierId(supplierId);
    }

    /**
     * 查询供应商列表
     *
     * @param wcfSupplier 供应商
     * @return 供应商
     */
    @Override
    public List<WcfSupplier> selectWcfSupplierList(WcfSupplier wcfSupplier)
    {
        return wcfSupplierMapper.selectWcfSupplierList(wcfSupplier);
    }

    /**
     * 新增供应商
     *
     * @param wcfSupplier 供应商
     * @return 结果
     */
    @Override
    public int insertWcfSupplier(WcfSupplier wcfSupplier)
    {
        wcfSupplier.setCreateAt(new Date());
        wcfSupplier.setDelFlag(0);
        return wcfSupplierMapper.insertWcfSupplier(wcfSupplier);
    }

    /**
     * 修改供应商
     *
     * @param wcfSupplier 供应商
     * @return 结果
     */
    @Override
    public int updateWcfSupplier(WcfSupplier wcfSupplier)
    {
        wcfSupplier.setUpdateAt(new Date());
        wcfSupplier.setDelFlag(0);
        return wcfSupplierMapper.updateWcfSupplier(wcfSupplier);
    }

    /**
     * 批量删除供应商
     *
     * @param supplierIds 需要删除的供应商主键
     * @return 结果
     */
    @Override
    public int deleteWcfSupplierBySupplierIds(Long[] supplierIds)
    {
        return wcfSupplierMapper.deleteWcfSupplierBySupplierIds(supplierIds);
    }

    /**
     * 删除供应商信息
     *
     * @param supplierId 供应商主键
     * @return 结果
     */
    @Override
    public int deleteWcfSupplierBySupplierId(Long supplierId)
    {
        return wcfSupplierMapper.deleteWcfSupplierBySupplierId(supplierId);
    }
}
